package com.ns.scs.task.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ns.core.entry.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;


/**
 * 定时任务日志
 *
 * @author liao.wei
 * @since 2024/11/11
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@Accessors(chain = true)
@TableName(value = "SCSS_SCHEDULED_LOGS")
public class ScheduledTaskLogs extends BaseModel {
    /**
     * 此模块对应的表名
     */
    public static final String TABLE_NAME = "SCSS_SCHEDULED_LOGS";

    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 定时任务名称
     */
    private String taskName;

    /**
     * 所属执行器
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long actuatorId;

    /**
     * cron表达式
     * eg: 每天凌晨1点执行一次：0 0 1 * * ?
     */
    private String cronExpression;

    /**
     * 执行接口
     */
    private String interfaceUrl;

    /**
     * 执行状态 0 待执行 1 执行中
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long taskId;

    /**
     * 日志
     */
    private String logs;
}